<?php get_instance()->view('common/header');?>
<!--<body class="bagimg">-->
<body>
<!--<img class="wp100 pos" style="left: 0;top:0;z-index: -1;" src="<?php echo $this->staticUrl?>/img/png/zzz1.png" alt="">
<img class="wp100 pos" style="left: 0;bottom:0;z-index: -1;" src="<?php echo $this->staticUrl?>/img/png/zzz2.png" alt="">-->
<form action="<?php echo getUrl('user/loginByCode')?>" id="save-form" method="post">
    <div class="wp80 m0a loginbox">
        <div class="m0a pt30" style="padding-top: 3em; width:170px;padding-bottom: 2em;"><img class=" wp100" src="<?php echo $this->staticUrl?>/img/png/login3.png" alt=""></div>
        <div class="logininput pr">
            <img  src="<?php echo $this->staticUrl?>img/png/login1.png" class="heightimg" alt="">
            <input name="mobile" type="text" placeholder="请填写手机号" class="f10" maxlength="11">
			<a href="javascript:;" class="szzz f10 dk sendyzm" style="color:#e55724;background:#fff;">获取验证码</a>
        </div>
        <div class="logininput mb20 pr">
            <img src="<?php echo $this->staticUrl?>img/png/login2.png" class="heightimg" alt="">
            <input name="code" type="code" placeholder="请输入验证码" class="f10">
        </div>
        <input type="hidden" name="merchant_id" value="<?php echo $merchant_id;?>">
<!--        <div>没有账号？ <a href="">请注册</a></div>-->
        <button class="kbtn" href="">登 录</button>
        <!--<div class="heng f08 mt10 wp94 m0a">
            <a class="lanzi" href="<?php echo getUrl('user/register');?>">快速注册</a>
            <a class="lanzi" href="<?php echo getUrl('user/forgetPassword');?>">忘记密码</a>
        </div>-->
    </div>
</form>
</body>
<script src="<?php echo $this->staticUrl?>js/base.js"></script>
<script type="text/javascript">
    $(function () {
        $.e_validate.init('#save-form',{saveMessage:'保存中...'});
    })
	

    $(function(){

        $('.sendyzm').click(function(){
            var phone = $('[name="mobile"]').val();
            if(phone == ""){
                show_message({status:0, message:'请输入手机号码'});
                return false;
            }
            var reg = /^0?1[3|4|5|7|8|9][0-9]\d{8}$/;
            if (!(reg.test(phone))) {
                show_message({status:0, message:'请输入正确的手机号码'});
                return false;
            }

            $.ajax({
                url: '<?php echo getUrl("user/getVerifyCode")?>',
                type:"POST",
                data:{
                    mobile:phone
                },

                success:function(arr){
                    if(arr.status == "1"){
                        tt = setInterval(time_show,1000);
                    }
                    show_message({status:arr.status, message:arr.message});

                    return false;
                },
                dataType:'json'
            });
        })
    });

    var time=60;
    function time_show(){
        if(time>1){
            time=time-1;
            $(".sendyzm").text(time+'s');
            $('[name="mobile"]').attr("readonly",true);
        }else{
            $(".sendyzm").text('重新获取');
            $('[name="mobile"]').attr("readonly",false);
            $('.sendyzm').attr('disabled',false);
            clearInterval(tt);
            time=60;
        }

    }
</script>
</html>